package com.zz.ecommerce.declareManage.importB2CDeclareDirect.paybillInsp;

import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import com.zz.ecommerce.common.bean.insp.db.payment.TPaymentHeadInsp;
import com.zz.ecommerce.common.constants.CommonConstant;
import com.zz.ecommerce.common.constants.CommonConstants;
import com.zz.ecommerce.declareManage.common.service.PayBillQdcService;
import com.zz.ecommerce.utils.SessionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * Created by zhangguowei on 2016/3/28.
 * <p/>
 * 支付单管理
 */
@Controller
@RequestMapping("/importB2CDirect/payBillInsp")
@Scope("prototype")
public class PayBillDirectInspController {

    @Autowired
    private PayBillQdcService payBillQdcService;

    @RequestMapping("/index")
    public String init() {
        return "declareManage/importB2CDeclareDirect/payBillInsp/index";
    }


    @RequestMapping("/queryPayBillList")
    @ResponseBody
    public GridResult queryPayBillListInsp(TPaymentHeadInsp tPaymentHeadInsp, GridRequest request, HttpSession session) {
        tPaymentHeadInsp.setOrgId(SessionUtil.getOrganizationId(session));
        return new GridResult(payBillQdcService.queryPayBillListInsp(request, tPaymentHeadInsp, CommonConstants.I_FALG, CommonConstant.BIZ_TYPE_DIRECT), request, payBillQdcService.countBillInsp(tPaymentHeadInsp, CommonConstants.I_FALG,  CommonConstant.BIZ_TYPE_DIRECT));
    }

}
